﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using CE.Global;

public partial class Provider_CarInsurance_TableMatching : System.Web.UI.Page
{
    string PageName = "CXCI";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[CE.Global.General.UserId] == null || Session[CE.Global.General.ProviderCompanyId] == null)
        {
            Response.Redirect("~/Provider/ProviderSecureLogin.aspx");
        }
        CheckMainPageAccess();
        CheckSubPageAccess();

 

        //switch (Session[CE.Global.General.ProviderCompanyId].ToString())
        //{
        //    case "32": //BKI
        //    case "29": //LMG
        //    case "11": //AZCp
        //    case "12": //MSIG
        //    case "31": //Chartis
        //        divMain .Visible = true;
        //        break;
        //    case "30": //Etiqa
        //        break;
        //}


    }


    private void CheckMainPageAccess()
    {
        Int64 PageAccess = General.GetProviderMainPageAccess(Convert.ToInt64(Session[General.ProviderCompanyId].ToString()),
                                                        Convert.ToInt64(Session[General.UserId].ToString()), PageName);
        if (PageAccess == 0)
        {
            Response.Redirect("~/Provider/UserMessage.aspx?mt=UM&ec=2000");
        }
    }

    private void CheckSubPageAccess()
    {
        Int64 PageAccess = General.GetProviderSubPageAccess(Convert.ToInt64(Session[General.ProviderCompanyId].ToString()),
                                                        Convert.ToInt64(Session[General.UserId].ToString()), "CXCITEST");
        if (PageAccess == 0)
        {
            lnkTestCarInsurance.Visible = false;
            
        }
    }

}
